Rename strategy name to match devise omniauth patterns #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Carbon copy of #12. This should really be fixed.
This PR aims to resolve an integration issue between your gem and OmniAuth 2 within the Devise ecosystem. The current problem arises from the strategy name not being properly normalized, resulting in conflicts that skip the middleware. Additionally, there is an issue with the
on_auth_path?
method from the OmniAuth strategy not matching under Devise configurations. Let's delve into these points in more detail for improved clarity and readability.The specific line in the OmniAuth gem (https://github.com/omniauth/omniauth/blob/a86acdfd7639c9e4c4dc9968d36c1eae0e9141d7/lib/omniauth/strategy.rb#LL187C7-L187C56) expects to find the authentication path that matches the name "cognito-idp".
However, the normalization methods used by Devise expect patterns from Rails routes to use underscores (
_
), resulting in callbacks and methods expecting "cognito_idp".Consequently, the strategy in the middleware gets ignored because it expects the correct name.
To address this issue, the proposed solution involves renaming the strategy to match the expected methods from Devise's OmniAuth callbacks controller.